Skip to content

fix(openclaw-plugin): serialize per-session commits to prevent CONFLICT errors#1035

Closed
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/commit-in-progress-overlap
Closed

fix(openclaw-plugin): serialize per-session commits to prevent CONFLICT errors#1035
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/commit-in-progress-overlap

Conversation

@mobilebarn
Copy link
Copy Markdown

Summary

  • Adds a per-session commit lock (promise chain) in context-engine.ts to serialize overlapping commitSession calls targeting the same OV session ID.
  • The OV server rejects concurrent commits on the same session with a CONFLICT error. The plugin has three independent code paths (afterTurn, doCommitOVSession via before_reset/compact, and memory_store) that can overlap. This change ensures they execute sequentially via withCommitLock.
  • Exposes commitWithLock on the ContextEngineWithSessionMapping type so index.ts callers can opt in to the same lock in the future.

Test plan

  • npx tsc --noEmit passes with no errors
  • npx vitest run passes (10/10 tests)
  • Manual: trigger concurrent afterTurn + before_reset commits and verify no CONFLICT errors
  • Manual: verify memory_store tool still works when context engine is active

…CT errors

Adds a per-session commit lock (promise chain) in the context engine
to serialize overlapping commits from afterTurn, before_reset, and
compact fallback paths. The OV server rejects concurrent commits on
the same session with CONFLICT; this ensures they run sequentially.
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@mobilebarn
Copy link
Copy Markdown
Author

Closing — upstream PR #1040 (context engine refactor, merged 2026-03-28) and #1053 (defensive re-spawn) supersede these changes. The issues these PRs addressed are now resolved in main. Thank you to the OV team for the comprehensive refactor.

@mobilebarn mobilebarn closed this Mar 29, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant